<template>
    <div class="heart" :style="{scale: scale}"></div>
</template>

<script setup lang="ts">
const props = defineProps({
    scale: {
        type: Number,
        default: 1,
    },
})
</script>

<style scoped lang="scss">
.heart {
  width: 1rem;
  height: 1rem;
  background-color: red;
  position: relative;
  transform: rotate(-45deg);
  margin: 0 auto;
  box-shadow: 0 0 0.1rem 0.05rem var(--box-shadow);
  animation: heartScale 0.6s linear infinite;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 1rem;;
  height: 1rem;;
  background-color: red;
}

.heart::before {
  border-radius: 0.5rem 0.5rem 0 0;
  top: -0.5rem;
  left: 0;
}

.heart::after {
  border-radius: 0.5rem 0.5rem 0.5rem 0;
  top: 0;
  left: 0.5rem;
}

@keyframes heartScale {
    0%{
        transform: rotate(-45deg) scale(1.07);
    }
    80%{
        transform: rotate(-45deg) scale(1.0);
    }
    100%{
        transform: rotate(-45deg) scale(0.8);
    }
}
</style>